package behavioral.command_partten;

/**
 * @ClassName: Invoker
 * @Description: 调用者：将命令对象传递给它使用execute()方法执行命令
 * @Author: liu-hao
 * @Date: 2023-04-11 22:42
 * @Version: 1.0
 **/
public class Invoker {
    private Command command;

    public Invoker(Command command) {
        this.command = command;
    }

    public void executeCommand() {
        command.execute();
    }

    public void undoCommand() {
        command.undo();
    }
}
